/**
 * The Woosta Table Football Engine
 *
 * License... etc.
 **
 * WTF Game Objects
 **
 * Author: Sean Micklethwaite
 **/

#include "wtflogic.h"
#include "pmodel.h"
#include "3dx.h"


using namespace Wtf;

#ifdef NOT

void Row::onMouseMove(MouseMoveEvent &ev) {
	// XXX TODO - get real screen dimensions
	unsigned width = 800; //Renderer::GetInstance().GetScreen()->
	unsigned height = 600; height = 600;
	Angle	a;

	a.setInRads(-((double)ev.x() + (double)(width/2)) * (M_PI / (double)width));
	
	this->setPosition(
		tVector(this->getPosition().x(),
			this->getPosition().y(), 300.0 - (double)ev.y()));
	
};

void Row::Update() {
	
};

Row::Row()
: Physical(WtfGraphics::GraphicsData::tRef(new WtfGraphics::Primitives::Cylinder(5.0f, 1000.0f, 10)),
		   PhysicalModel::tRef(new PhysicalModels::Cube(10.0)))
{
	Angle a;
	a.setInDegs(90);
};

Table::Table()
: Static(WtfGraphics::GraphicsData::tRef(new WtfGraphics::Primitives::Oblong(40.0,2,18.0)))
{
	Static *w = new Static(WtfGraphics::GraphicsData::tRef(new WtfGraphics::Primitives::Oblong(0.2,100,18.0)));
	w->setPosition(tVector(40,0,0));

	w = new Static(WtfGraphics::GraphicsData::tRef(new WtfGraphics::Primitives::Oblong(0.2,100,18.0)));
	w->setPosition(tVector(-40,0,0));
};


Ball::Ball()
: Physical(WtfGraphics::GraphicsData::tRef(new WtfGraphics::Primitives::Oblong(2,2,2)),
		   PhysicalModel::tRef(new PhysicalModels::Cube(1.0)))
{
	this->setPosition(tVector(-20,40,5));
	tVector vtmp = tVector(0.0, -160, 0.0);
	this->applyForce(Force::tRef(new Force(vtmp)));
	//this->setAngularMomentum(tVector(0, 0, 1000));
};

void Ball::Update() {};

// Test Mesh - look in 3dx.h for more test meshes and change the following code
TestMesh::TestMesh()
: Static(WtfGraphics::GraphicsData::tRef(new WtfGraphics::Test::Wall()))
{
	// showcasing position
	// this->setPosition(tVector(100,0,-50));
	// default position
	// this->setPosition(tVector(-20,10,-50));
	
	this->setPosition(tVector(0,0,-50));
};

#endif
